<template>
  <div class="container">
    <div class="login">
      <div class="Left">
        <div class="logo-container">
          <img src="../assets/3.png" alt="Logo" class="logo">
          <h1 class="welcome-text">欢迎登录</h1>
        </div>
      </div>
      <div class="right">
        <h2 class="login-title">登录</h2>
        <form @submit.prevent="handleLogin">
          <div class="input-group">
            <input 
              type="text" 
              v-model="username"
              placeholder="用户名/手机号/邮箱"
              required
            >
          </div>
          <div class="input-group">
            <input 
              type="password"
              v-model="password" 
              placeholder="请输入密码"
              required
            >
          </div>
          <div class="remember-forgot">
            <label>
              <input type="checkbox" v-model="remember"> 记住我
            </label>
            <a href="#" class="forgot-link">忘记密码？</a>
          </div>
          <button type="submit" class="login-btn">登录</button>
          <div class="register-link">
            还没有账号？<a href="#">立即注册</a>
          </div>
        </form>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      password: '',
      remember: false
    }
  },
  methods: {
    handleLogin() {
      // 处理登录逻辑
      console.log('登录信息:', {
        username: this.username,
        password: this.password,
        remember: this.remember
      })
    }
  }
}
</script>

<style>
.container {
  width: 100%;
  min-height: 100vh;
  background: #f7f7f7ef;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login {
  width: 100%;
  max-width: 1000px;
  min-height: 500px;
  background: #fff;
  display: flex;
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

@media (max-width: 768px) {
  .login {
    flex-direction: column;
    max-width: 400px;
  }
  
  .Left {
    min-height: 200px;
  }
}

.Left {
  flex: 1;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.logo-container {
  text-align: center;
}

.logo {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}

.welcome-text {
  color: #fff;
  font-size: 24px;
  margin: 0;
}

.right {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-title {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.input-group input:focus {
  border-color: #6e8efb;
  outline: none;
}

.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.forgot-link {
  color: #6e8efb;
  text-decoration: none;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.login-btn:hover {
  opacity: 0.9;
}

.register-link {
  text-align: center;
  margin-top: 20px;
}

.register-link a {
  color: #6e8efb;
  text-decoration: none;
}

/* 适配移动端的额外样式 */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  .right {
    padding: 20px;
  }
  
  .input-group input {
    padding: 10px;
  }
  
  .login-btn {
    padding: 10px;
  }
}
</style>